package TeXing.src.Day2.ZuoYe;

import java.util.Scanner;

//2:输入字符串，计算可转换成的最大浮点数字，从左侧开始，直到非数字结束，
//比如输入124abc,则最大是124，如果是122.44fff,则是122.44
public class Zuoye2 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入字符串：");
        String s = input.next();
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) >= 48 && s.charAt(i) <= 57 )||(s.charAt(i) == 46 && count < 1)) {
                System.out.print(s.charAt(i));
                if (s.charAt(i) == 46)
                    count++;
            } else {
                return;
            }
        }
    }
}
